//Component Object
Component({
    data: {
       isLogin: false,
    },
    methods: {
        
    },
    created: function(){

    },
    attached: function(){
        const isLogin = !!getApp().token
        this.setData({ isLogin })
        const pageStack = getCurrentPages()
        const {route} = pageStack.pop()
        if (!isLogin) {
            wx.redirectTo({
                url: '/pages/login/index?redirectURL=/' + route,
            })
        }
    },
    ready: function(){

    },
    moved: function(){

    },
    detached: function(){

    },
});